<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../base.jsp" %> 

<sys:genericTag4o 
	id="empDto" 
	methodName="getEmpById" 
	className="com.tmpt.controller.taglib.SecurityTag">
	<sys:columnTag columnName="empId" columnValue="${param.empId}"/>
</sys:genericTag4o>
<sys:genericTag4o id="roleList" methodName="queryRoleList" className="com.tmpt.controller.taglib.SecurityTag"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>用户授权</title>    
<link href="../css/main.css" rel="stylesheet" type="text/css" >
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui/themes/icon.css">
<script type="text/javascript" src="${path}/js/jquery-1.8.0.min.js"></script>
<script src="${path}/js/jquery/easyui/jquery.easyui.min.js"></script>
</head>
<body class="font14">
<div style="color: red; text-align: center;">
	<s:property value="#attr.result"/>
</div>
<s:form name="form1" action="user_bindingRoleToEmp.action" namespace="/admin123/user" theme="simple">
<input type="hidden" name="empId" value="${param.empId}"/>
<table class="table1" cellpadding="0" cellspacing="0" align="center" width="400">
	<thead>
		<tr>
			<td colspan="5">给用户增加角色</td>
		</tr>
	</thead>
	<tr>
		<td>
			用户名:${attr.empDto.name}
		</td>
		<td>
			角色:
			<s:select 
				list="#attr.roleList"
				listKey="id"
				listValue="roleName"
				headerKey=""
				headerValue="请选择"
				theme="simple"
				name="roleId"
				/>
		</td>
		<td>
			<a href="#" onclick="document.form1.submit();" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-ok'">绑定</a>
		</td>
	</tr>
</table>
<br/>
<table class="table1" cellpadding="0" cellspacing="0" width="400" align="center">
	<thead>
	<tr>
		<td colspan="2">用户当前拥有的权限</td>
	</tr>
	</thead>
	<tr>
		<td valign="top">
			<s:select 
				list="#attr.empDto.a1RoleDtoList"
				listKey="id"
				listValue="roleName"
				headerKey="0"
				headerValue="==== 角色列表  ===="
				theme="simple"
				size="15"
				cssStyle="width:200px;"
				name="roleId1"
				/>
			<a href="#" onclick="deleteRoleFromEmp();" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-cancel'">删除选中角色</a>
			<script type="text/javascript">
			function deleteRoleFromEmp(){
				document.form1.action='user_unbindingRoleToEmp.action';
				document.form1.submit();
			}
			</script>
		</td>
		<td valign="top">
			<s:select 
				list="#attr.empDto.authNameSet"
				headerKey=""
				headerValue="==== 权限列表  ====="
				theme="simple"
				size="15"
				cssStyle="width:200px;"
				/>
		</td>
	</tr>
</table>
</s:form>
</body>
</html>